package com.dundun.pattern.flyweight;

public class BigString {

    private BigChar[] bigChars;

    public BigString(String string) {
        bigChars = new BigChar[string.length()];
        BigCharFactory factory = BigCharFactory.getInstance();
        int i=0;
        for(char c : string.toCharArray()) {
            bigChars[i++] = factory.getBigChar(c);
        }
    }

    public void print() {
        for(BigChar bigChar : bigChars)
            bigChar.print();
    }
}
